<template>
  <div>
    <el-card>
      <el-form ref="shopQueryList" :inline="true">
        <el-form-item label="素材名称">
          <el-input v-model="shopQueryList.shopName" placeholder="请输入素材" />
        </el-form-item>
        <el-form-item label="素材类别">
          <el-select v-model="form.region" placeholder="请选择">
            <el-option label="区域一" value="shanghai" />
            <el-option label="区域二" value="beijing" />
          </el-select>
        </el-form-item>
        <el-form-item label="上传者">
          <el-select v-model="form.region" placeholder="请选择">
            <el-option label="区域一" value="shanghai" />
            <el-option label="区域二" value="beijing" />
          </el-select>
        </el-form-item>
        <el-row type="flex" justify="end" :gutter="20">
          <el-button type="primary">查询</el-button>
          <el-button>重置</el-button>
          <el-link type="primary">展开</el-link>
        </el-row>
        <el-table
          :data="tableData"
          style="width: 100%"
        >
          <el-table-column
            prop="materialName"
            label="素材名"
            width="180"
          />
          <el-table-column
            prop="materiaImg"
            label="缩略图"
            width="180"
          />
          <el-table-column
            prop="materiaType"
            label="类别"
          />
          <el-table-column
            prop="price"
            label="价格"
          />
          <el-table-column
            prop="Upload"
            label="上传日期"
          />
          <el-table-column label="确认退款率">
            <el-button type="primary" size="mini">编辑</el-button>
            <el-button type="danger" size="mini">删除</el-button>
          </el-table-column>
        </el-table>
      </el-form>
      <div class="block">
        <el-pagination
          :current-page="currentPage4"
          :page-sizes="[100, 200, 300, 400]"
          :page-size="100"
          layout="total, sizes, prev, pager, next, jumper"
          :total="400"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
        />
      </div>
    </el-card>
  </div>
</template>
<script>
import { getOfficialmaterialList } from '@/api/discount.js'
export default {
  name: 'Material',
  data() {
    return {
      shopQueryList: {},
      form: {
        region: ''
      },
      tableData: [{
        materialName: '', // 素材名
        materiaImg: '', // 略缩图
        materiaType: '', // 类别
        price: '', // 价格
        Upload: ''// 上传日期
      }]
    }
  },
  created() {
    this.getOfficialmaterialList()
  },
  methods: {
    async getOfficialmaterialList() {
      const res = await getOfficialmaterialList()
      this.tableData = res.data.data
      console.log(this.tableData)
    }
  }
}
</script>

<style lang="less" scoped></style>
